home *** CD-ROM | disk | FTP | other *** search
/ Sports Illustrated for Kids - Awesome Athletes! / Sports Illustrated for Kids - Awesome Athletes!.iso / hf.dir / 00025.ls < prev    next >
Encoding:
Text File  |  1996-04-19  |  12.8 KB  |  424 lines

  1. global ghfathlete, ghfathletelist, gHFsearchlist, gHFposition, gHFactivelist, gHFstate, gHFline, gHFsearchcastmember, gHFAthleteMode, gHFlastTicket, gHFaList, gHFsList, gHFaMax, gHFsMax, gHFpageno, gHFpastathleteno, gHFpage1, gHFpage2, gHFpage3, gHFpage4, gHFlinesdisply, ghfathleteno, ghfmaxathleteno, ghfslideno, gHFsidebarno, gHFmaxsidebarno, gHFpass, gHFpreviousline, gHFDone
  2.  
  3. on startMovie
  4.   global gHSCount, gSIlinkinfo, gSIVideoPath, gSISystem
  5.   set the exitLock to 1
  6.   set the visible of sprite 19 to 1
  7.   set the visible of sprite 30 to 1
  8.   set the visible of sprite 31 to 1
  9.   set the visible of sprite 32 to 1
  10.   set the stretch of sprite 13 to 0
  11.   set the stretch of sprite 2 to 0
  12.   DVSetPlayArea(161, 108, 320, 240)
  13.   InitHotLinks()
  14.   set gHFDone to 0
  15.   set gHFAthleteMode to 1
  16.   set gHFlastTicket to 0
  17.   puppetSprite(16, 1)
  18.   preLoadCast(71, 73)
  19.   preLoadCast(83, 87)
  20.   set gHFsList to []
  21.   set gHFsMax to 0
  22.   set the itemDelimiter to numToChar(13)
  23.   set vNum to the number of cast "database"
  24.   set vlines to the number of lines in field vNum
  25.   if (ghfathlete = []) or not objectp(ghfathlete) then
  26.     set ghfathlete to []
  27.     repeat with vcounter = 1 to vlines
  28.       append(ghfathlete, item vcounter of field vNum)
  29.     end repeat
  30.     set gHFaList to value(string(ghfathlete))
  31.   end if
  32.   put "DUCK" && gSIlinkinfo && value(gSIlinkinfo)
  33.   if value(gSIlinkinfo) = 0 then
  34.     put "Duck RESTORE"
  35.     set ghfathleteno to value(HSStateGet("hf", "gHFathleteno"))
  36.     set gHFpastathleteno to value(HSStateGet("hf", "gHFpastathleteno"))
  37.     set gHFposition to value(HSStateGet("hf", "gHFposition"))
  38.     set ghfslideno to value(HSStateGet("hf", "gHFslideno"))
  39.   else
  40.     put "Duck LINK"
  41.     set ghfathleteno to gSIlinkinfo
  42.     set gHFpastathleteno to 0
  43.     set gHFposition to athleteToPosition(ghfathleteno)
  44.     set ghfslideno to 1
  45.     set gSIlinkinfo to EMPTY
  46.   end if
  47.   if ghfathleteno = 0 then
  48.     put "Duck DEFAULT"
  49.     set ghfathleteno to "001"
  50.     set gHFpastathleteno to 0
  51.     set gHFposition to athleteToPosition(ghfathleteno)
  52.     set ghfslideno to 1
  53.   end if
  54.   set ghfathlete to []
  55.   set ghfmaxathleteno to 285
  56.   set gHFaMax to ghfmaxathleteno
  57.   set gHFpageno to 1
  58.   set gHFlinesdisply to 19
  59.   set gHFsidebarno to 1
  60.   set gHFmaxsidebarno to 2
  61.   set the itemDelimiter to numToChar(13)
  62.   set vNum to the number of cast "database"
  63.   set vlines to the number of lines in field vNum
  64.   if ghfathlete = [] then
  65.     repeat with vcounter = 1 to vlines
  66.       append(ghfathlete, item vcounter of field vNum)
  67.     end repeat
  68.   end if
  69.   set the visible of sprite 20 to 0
  70.   puppetSprite(15, 1)
  71.   puppetSprite(16, 1)
  72.   paintscreen()
  73.   updateStage()
  74.   if gSISystem = "WIN" then
  75.     mci("open " & gSIVideoPath & "hofpal.mov type QTWVideo alias hofpal")
  76.     mci("status hofpal palette handle")
  77.     set vPal to the result
  78.   else
  79.     set vPal to EMPTY
  80.   end if
  81.   DVUse(gSIVideoPath & "HALLFAME")
  82.   mci("realize dvvid background")
  83. end
  84.  
  85. on cleanUp
  86.   global gSISystem
  87.   DVClose()
  88.   if gSISystem = "WIN" then
  89.     mci("close hofpal")
  90.   end if
  91.   HSStatePut("hf", "gHFathleteno", string(ghfathleteno))
  92.   HSStatePut("hf", "gHFpastathleteno", string(gHFpastathleteno))
  93.   HSStatePut("hf", "gHFposition", string(gHFposition))
  94.   HSStatePut("hf", "gHFslideno", string(ghfslideno))
  95. end
  96.  
  97. on keyDown
  98.   if the keyCode = 122 then
  99.     LaunchHelp()
  100.   end if
  101. end
  102.  
  103. on paintscreen
  104.   set gHFsearchcastmember to 11
  105.   set the itemDelimiter to ","
  106.   set ghfathleteno to item 2 of getaProp(ghfathlete, gHFposition)
  107.   LoadAthleteDB()
  108.   set the visible of sprite 12 to 0
  109.   set vName to item 6 of getaProp(ghfathlete, gHFposition)
  110.   if vName = "SS" then
  111.     set the visible of sprite 12 to 1
  112.   end if
  113.   set the itemDelimiter to ","
  114.   set vName to item 6 of getaProp(ghfathlete, gHFposition)
  115.   set athletename to "AN" & vName & ghfathleteno & ".PCT"
  116.   puppetSprite(2, 1)
  117.   set the castNum of sprite 2 to cast GetAssetNo(athletename)
  118.   set the stretch of sprite 2 to 0
  119.   set vName to "BIO" & ghfathleteno
  120.   set gHFpageno to 1
  121.   puppetSprite(4, 1)
  122.   set the castNum of sprite 4 to cast GetAssetNo(vName & gHFpageno)
  123.   set vpages to item 1 of getaProp(ghfathlete, gHFposition)
  124.   set vpagingcaption to "1 of " & vpages
  125.   set the text of cast 28 to vpagingcaption
  126.   set vName to "TN" & ghfathleteno
  127.   puppetSprite(11, 1)
  128.   set the castNum of sprite 11 to cast GetAssetNo(vName)
  129.   puppetSprite(3, 1)
  130.   set the itemDelimiter to ","
  131.   set vName to item 7 of getaProp(ghfathlete, gHFposition)
  132.   set vslidev to "SFV" & vName & ".PCT"
  133.   set vslideh to "SFH" & vName & ".PCT"
  134.   set ghfslideno to "01"
  135.   set vName to "IM" & ghfathleteno & ghfslideno
  136.   puppetSprite(13, 1)
  137.   set the stretch of sprite 13 to 0
  138.   set the regPoint of cast GetAssetNo(vName) to point(0, 0)
  139.   set the castNum of sprite 13 to cast GetAssetNo(vName)
  140.   if the width of cast GetAssetNo(vName) > the height of cast GetAssetNo(vName) then
  141.     set the castNum of sprite 3 to cast vslideh
  142.     set the regPoint of cast vslideh to point(320, 240)
  143.     set the locV of sprite 3 to 240
  144.     set the locH of sprite 3 to 320
  145.     set the locV of sprite 13 to 110
  146.     set the locH of sprite 13 to 377
  147.   else
  148.     set the castNum of sprite 3 to cast vslidev
  149.     set the regPoint of cast vslidev to point(320, 240)
  150.     set the locV of sprite 3 to 240
  151.     set the locH of sprite 3 to 320
  152.     set the locV of sprite 13 to 87
  153.     set the locH of sprite 13 to 402
  154.   end if
  155.   liteled()
  156.   set the itemDelimiter to ","
  157.   set vnumofslides to item 3 of getaProp(ghfathlete, gHFposition)
  158.   if vnumofslides = 1 then
  159.     set the visible of sprite 18 to 0
  160.     set the visible of sprite 19 to 0
  161.     set the visible of sprite 21 to 1
  162.   else
  163.     set the visible of sprite 18 to 1
  164.     set the visible of sprite 19 to 1
  165.     set the visible of sprite 21 to 0
  166.   end if
  167.   set vName to "HFSK0" & vnumofslides & ".pct"
  168.   puppetSprite(14, 1)
  169.   set the castNum of sprite 14 to cast vName
  170.   set vVis to 0
  171.   repeat with vI = 1 to 3
  172.     if GetAssetNo("SIDE" & ghfathleteno & "11" & vI) >= 1 then
  173.       set vVis to 1
  174.       exit repeat
  175.     end if
  176.   end repeat
  177.   set the visible of sprite 30 to vVis
  178.   set vVis to 0
  179.   repeat with vI = 1 to 3
  180.     if GetAssetNo("SIDE" & ghfathleteno & "21" & vI) >= 1 then
  181.       set vVis to 1
  182.       exit repeat
  183.     end if
  184.   end repeat
  185.   set the visible of sprite 31 to vVis
  186.   set vVis to 0
  187.   repeat with vI = 1 to 3
  188.     if GetAssetNo("SIDE" & ghfathleteno & "31" & vI) >= 1 then
  189.       set vVis to 1
  190.       exit repeat
  191.     end if
  192.   end repeat
  193.   set the visible of sprite 32 to vVis
  194.   set the visible of sprite 9 to 0
  195.   set the itemDelimiter to ","
  196.   set vTemp to item 8 of getaProp(ghfathlete, gHFposition)
  197.   if vTemp = 1 then
  198.     set the visible of sprite 39 to 1
  199.   else
  200.     set the visible of sprite 39 to 0
  201.   end if
  202.   set the itemDelimiter to ","
  203.   set vTemp to item 10 of getaProp(ghfathlete, gHFposition)
  204.   if vTemp = 1 then
  205.     set the visible of sprite 10 to 1
  206.   else
  207.     set the visible of sprite 10 to 0
  208.   end if
  209.   updateStage()
  210. end
  211.  
  212. on changeslide2
  213.   set the itemDelimiter to ","
  214.   set vnumberofslides to item 3 of getaProp(ghfathlete, gHFposition)
  215.   if gHFstate = "button" then
  216.     set vlocation to the mouseH
  217.     set vSKLoc to [rect(425, 336, 450, 365), rect(449, 352, 474, 381), rect(472, 335, 497, 364), rect(484, 365, 509, 394), rect(511, 349, 536, 378), rect(537, 341, 562, 370), rect(549, 374, 574, 403), rect(583, 350, 608, 379)]
  218.     set vPoint to point(the mouseH, the mouseV)
  219.     set vslide to 1
  220.     repeat with vI = 1 to vnumberofslides
  221.       if inside(vPoint, getAt(vSKLoc, vI)) then
  222.         set vslide to vI
  223.         exit repeat
  224.       end if
  225.     end repeat
  226.   end if
  227.   if gHFstate = "right" then
  228.     set vslide to value(ghfslideno) + 1
  229.   else
  230.     if gHFstate = "left" then
  231.       set vslide to value(ghfslideno) - 1
  232.     end if
  233.   end if
  234.   if vslide > vnumberofslides then
  235.     set vslide to 1
  236.   end if
  237.   if vslide < 1 then
  238.     set vslide to vnumberofslides
  239.   end if
  240.   puppetSprite(3, 1)
  241.   set the itemDelimiter to ","
  242.   set vName to item 7 of getaProp(ghfathlete, gHFposition)
  243.   set vslidev to "SFV" & vName & ".PCT"
  244.   set vslideh to "SFH" & vName & ".PCT"
  245.   set vName to "IM" & ghfathleteno & "0" & vslide
  246.   if vslide <> ghfslideno then
  247.     puppetSprite(13, 1)
  248.     set the stretch of sprite 13 to 0
  249.     set the castNum of sprite 13 to cast GetAssetNo(vName)
  250.     set the regPoint of cast GetAssetNo(vName) to point(0, 0)
  251.     if the width of cast GetAssetNo(vName) > the height of cast GetAssetNo(vName) then
  252.       set the castNum of sprite 3 to cast vslideh
  253.       set the regPoint of cast vslideh to point(320, 240)
  254.       set the locV of sprite 3 to 240
  255.       set the locH of sprite 3 to 320
  256.       set the locV of sprite 13 to 110
  257.       set the locH of sprite 13 to 377
  258.     else
  259.       set the castNum of sprite 3 to cast vslidev
  260.       set the regPoint of cast vslidev to point(320, 240)
  261.       set the locV of sprite 3 to 240
  262.       set the locH of sprite 3 to 320
  263.       set the locV of sprite 13 to 87
  264.       set the locH of sprite 13 to 402
  265.     end if
  266.     puppetSound("flip.aif")
  267.     updateStage()
  268.   end if
  269.   set ghfslideno to vslide
  270.   liteled()
  271.   set gHFstate to "0"
  272. end
  273.  
  274. on changes
  275.   puppetSound("page.aif")
  276.   updateStage()
  277.   set vcurrentpage to gHFpageno
  278.   set vName to "BIO" & ghfathleteno
  279.   if gHFstate = "next" then
  280.     set gHFpageno to gHFpageno + 1
  281.     if GetAssetNo(vName & gHFpageno) < 1 then
  282.       set gHFpageno to 1
  283.     end if
  284.   end if
  285.   if gHFstate = "previous" then
  286.     set gHFpageno to gHFpageno - 1
  287.     if gHFpageno < 1 then
  288.       set gHFpageno to item 1 of getaProp(ghfathlete, gHFposition)
  289.     end if
  290.   end if
  291.   set gHFpageno to integer(gHFpageno)
  292.   set vtemp123 to "gHFpage" & gHFpageno
  293.   if vcurrentpage <> gHFpageno then
  294.     set the castNum of sprite 4 to cast GetAssetNo(vName & gHFpageno)
  295.   end if
  296.   set vpages to item 1 of getaProp(ghfathlete, gHFposition)
  297.   set vpagingcaption to gHFpageno & " of " & vpages
  298.   set the text of cast 28 to vpagingcaption
  299.   set gHFstate to "0"
  300. end
  301.  
  302. on athlete
  303.   SetCursor(#wait)
  304.   if gHFstate starts "goto:" then
  305.     set vTmp to char 6 to 9 of gHFstate
  306.     set ghfathleteno to vTmp
  307.     set gHFpastathleteno to 0
  308.     set gHFposition to athleteToPosition(vTmp)
  309.     set ghfslideno to 1
  310.   else
  311.     if gHFstate = "greater" then
  312.       set gHFposition to gHFposition + 1
  313.     else
  314.       set gHFposition to gHFposition - 1
  315.     end if
  316.   end if
  317.   puppetSound("clik2.aif")
  318.   updateStage()
  319.   set gHFsidebarno to 1
  320.   if gHFposition > ghfmaxathleteno then
  321.     set gHFposition to 1
  322.   end if
  323.   if gHFposition < 1 then
  324.     set gHFposition to ghfmaxathleteno
  325.   end if
  326.   paintscreen()
  327.   set gHFstate to "0"
  328.   SetCursor(#normal)
  329. end
  330.  
  331. on wait
  332.   repeat while the mouseDown = 0
  333.     nothing()
  334.   end repeat
  335.   dontPassEvent()
  336. end
  337.  
  338. on pagetext
  339.   set the text of cast "page1" to EMPTY
  340.   set the text of cast "page2" to EMPTY
  341.   set the text of cast "page3" to EMPTY
  342.   set the text of cast "page4" to EMPTY
  343.   set the text of cast "page5" to EMPTY
  344.   set the text of cast "page6" to EMPTY
  345.   set vName to "BIO" & ghfathleteno
  346.   repeat with vI = 1 to 6
  347.     if the number of cast (vName & vI) > 1 then
  348.       set the text of cast ("page" & vI) to the text of cast GetAssetNo(vName & vI)
  349.       next repeat
  350.     end if
  351.     exit repeat
  352.   end repeat
  353. end
  354.  
  355. on mouseDown
  356.   global ghfathleteno, ghfslideno
  357.   if the frame = 1 then
  358.     set locH to the mouseH
  359.     set locV to the mouseV
  360.     if (locH > 430) and (locH < 600) then
  361.       if (locV > 127) and (locV < 300) then
  362.         set vTemp to value(ghfslideno)
  363.         set vName to "CAP" & ghfathleteno & "0" & vTemp
  364.         if GetAssetNo(vName) >= 1 then
  365.           dontPassEvent()
  366.           go("displaycaption")
  367.         end if
  368.         exit
  369.       end if
  370.     end if
  371.     hPressButton()
  372.   end if
  373. end
  374.  
  375. on exitFrame
  376.   UIRollover(47, 48)
  377.   hRolloverScript()
  378.   ticketRollover()
  379.   go(1)
  380. end
  381.  
  382. on hPressButton aStayDown
  383.   global gLastSprite
  384.   if voidp(aStayDown) then
  385.     set aStayDown to 0
  386.   end if
  387.   set vSprite to the clickOn
  388.   if not ((vSprite = 1) or (vSprite = 2) or (vSprite = 0) or (vSprite = 4) or (vSprite = 14) or (vSprite = 3) or (vSprite = 16)) then
  389.     set vCastNo to the castNum of sprite vSprite
  390.     set vCastNam to the name of cast vCastNo
  391.     puppetSprite(vSprite, 1)
  392.     if (vCastNam = 0) or (vCastNam = EMPTY) then
  393.       set the castNum of sprite vSprite to vCastNo + 1
  394.     else
  395.       if vCastNam contains "ROLLOVER" then
  396.         set the castNum of sprite vSprite to vCastNo + 1
  397.       else
  398.         set the castNum of sprite vSprite to the number of cast (vCastNam & "-down")
  399.       end if
  400.     end if
  401.     updateStage()
  402.     repeat while the stillDown
  403.       nothing()
  404.     end repeat
  405.     if (the mouseCast = the castNum of sprite vSprite) and aStayDown then
  406.       nothing()
  407.     else
  408.       if (vCastNam = 0) or (vCastNam = EMPTY) then
  409.         set the castNum of sprite vSprite to vCastNo
  410.       else
  411.         set the castNum of sprite vSprite to the number of cast vCastNam
  412.       end if
  413.       set gLastSprite to 0
  414.       puppetSprite(vSprite, 0)
  415.       updateStage()
  416.     end if
  417.     if the mouseCast = the castNum of sprite vSprite then
  418.       return 1
  419.     else
  420.       return 0
  421.     end if
  422.   end if
  423. end
  424.